package cn.com.pansky.comm.filter;

import java.io.IOException;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.vsame.url2sql.web.Url2SqlFilter;

/**
 * Servlet Filter implementation class Url2SqDruidlFilter
 */
public class Url2SqDruidlFilter extends Url2SqlFilter {

	@Override
	public void doFilter(ServletRequest _req, ServletResponse _resp, FilterChain chain) throws IOException, ServletException {
		HttpServletRequest request = (HttpServletRequest) _req;
		HttpServletResponse response = (HttpServletResponse) _resp;
		
		String uri = request.getRequestURI();
		if(uri!=null && uri.startsWith("/druid")) {
			chain.doFilter(request, response);
			return ;
		}
		super.doFilter(_req, _resp, chain);
	}
	
}
